using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ai520v.Models
{
    public class User
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int Id { get; set; }

        [Required]
        [StringLength(50)]
        public string Username { get; set; }

        [Required]
        public string PasswordHash { get; set; }

        [EmailAddress]
        public string Email { get; set; }

        [Required]
        [Phone]
        public string Phone { get; set; }

        [Required]
        public string Role { get; set; } = "employe";

        [Required]
        public string Status { get; set; } = "normal";

        public DateTime CreatedAt { get; set; } = DateTime.Now;

        public DateTime UpdatedAt { get; set; } = DateTime.Now;

        public DateTime LastLoginAt { get; set; } = DateTime.Now;

        [StringLength(255)]
        public string ProfileImage { get; set; } = "default.jpg";

        [Required]
        public string Salt { get; set; }

        [StringLength(50)]
        public string Group { get; set; } = "";
    }
}